<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property int $id
 * @property int $cat_id
 * @property string $name
 * @property string $image
 * @property string $goods_desc
 * @property int $day_per
 * @property boolean $status
 * @property string $updated_at
 * @property string $created_at
 */
class Goods extends Model
{
    /**
     * @var array
     */
    protected $fillable = ['cat_id', 'name', 'image', 'goods_desc', 'day_per', 'status', 'updated_at', 'created_at'];

    public function goods_cat_info(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne('App\Models\GoodsCat', "id", "cat_id");
    }

    public function goods_stock(): \Illuminate\Database\Eloquent\Relations\HasOne
    {
        return $this->hasOne('App\Models\GoodsStock', "goods_id", "id");
    }
}
